<template>
  <div class="search-button textCenter">
    <el-button type="primary" size="small" icon="el-icon-search" @click="getList">搜索</el-button>
    <el-button type="primary" size="small" icon="el-icon-refresh" @click="refreshParams">重置</el-button>
  </div>
</template>

<script>
export default {
  props: {
    defaultParams: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  data() {
    return {
      nullParams: ''
    }
  },
  mounted() {
    this.nullParams = JSON.stringify(this.defaultParams)
  },
  methods: {
    getList() {
      this.$emit('getList')
    },
    refreshParams() {
      this.$emit('refreshParams', JSON.parse(this.nullParams))
    }
  }
}
</script>

<style>
</style>
